package com.skytech.tax.customsdatawarehouse.singlewindow.revokelist.domain.entity;

import com.alibaba.fastjson.JSONObject;

/**
 * @author Lianhong
 * @since 2021/11/9
 */
public class CusAutoRevokeList {

    private String decModSeqNo;         //修撤单编号
    private String revokeList;          //修撤单信息
    private String entryId;             //报关单号
    private String cusCiqNo;            //统一编号
    private String updateTime;          //操作时间
    private String socialCreditCode;    //企业社会信用代码
    private String storageTime;         //入库时间

    public String getDecModSeqNo() {
        return decModSeqNo;
    }

    public void setDecModSeqNo(String decModSeqNo) {
        this.decModSeqNo = decModSeqNo;
    }

    public String getRevokeList() {
        return revokeList;
    }

    public void setRevokeList(String revokeList) {
        this.revokeList = revokeList;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public String getStorageTime() {
        return storageTime;
    }

    public void setStorageTime(String storageTime) {
        this.storageTime = storageTime;
    }

    public String getEntryId() {
        return entryId;
    }

    public void setEntryId(String entryId) {
        this.entryId = entryId;
    }

    public String getCusCiqNo() {
        return cusCiqNo;
    }

    public void setCusCiqNo(String cusCiqNo) {
        this.cusCiqNo = cusCiqNo;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public CusAutoRevokeListSimple buildRevokeListSimple() {
        CusAutoRevokeListSimple simple = new CusAutoRevokeListSimple();
        simple.setDecModSeqNo(decModSeqNo);
        return simple;
    }

    public void addField() {
        JSONObject revokeListObj = JSONObject.parseObject(revokeList);
        JSONObject decModHeadVo = revokeListObj.getJSONObject("data")
                .getJSONObject("decModVo")
                .getJSONObject("decModHeadVo");
        this.entryId = decModHeadVo.getString("entryId");
        this.cusCiqNo = decModHeadVo.getString("cusCiqNo");
        this.updateTime = decModHeadVo.getString("updateTime");
    }
}
